Intra-class adaptation fault diagnosis method for bearing under variable working conditions

ABSTRACT

The invention relates to a fault diagnosis method for a rolling bearing under variable working conditions. Based on a convolutional neural network, a transfer learning algorithm is combined to handle the problem of the reduced universality of deep learning models. Data acquired under different working conditions is segmented to obtain samples. The samples are preprocessed by using FFT. Low-level features of the samples are extracted by using improved ResNet-50, and a multi-scale feature extractor analyzes the low-level features to obtain high-level features as inputs of a classifier. In a training process, high-level features of training samples and test samples are extracted, and a conditional distribution distance between them is calculated as a part of a target function for backpropagation to implement intra-class adaptation, thereby reducing the impact of domain shift, to enable a deep learning model to better carry out fault diagnosis tasks.

FIELD OF THE INVENTION

The present invention relates to the fields of mechanical fault diagnosis and computer artificial intelligence technologies, and more particularly to an intra-class adaptation fault diagnosis method for a bearing under variable working conditions based on a convolutional neural network and transfer learning.

DESCRIPTION OF THE RELATED ART

With the development of industry in recent years, there is increasingly high requirement for long-time safe and reliable running of mechanical equipment. To avoid major economic loss and bodily injury, the development and application of fault diagnosis technologies become an important means for improving the safety and stability of mechanical systems. In the fault diagnosis technologies, the running status of the equipment is monitored to determine the position of a fault and inspect potential safety hazards in time. Therefore, to prevent catastrophic accidents, it is particularly important to enhance the status monitoring of the mechanical equipment to accurately recognize a fault in time. A rolling bearing is one of the key components of a rotary machine, and the health status of the rolling bearing directly affects the stability of the entire rotary machine. However, the rolling bearing remains in severe operating conditions such as high temperature, heavy load, and high speed for a long time and is prone to faults such as wear, cracks, and fractures, to severely jeopardize the safe running of the entire rotary system. Therefore, researches on status information of a rolling bearing and corresponding fault diagnosis technologies are of proactive and great significance to ensure safe and reliable running of the mechanical equipment, improve the production and operation efficiency, and protect human safety.

A lot of researches show that bearing vibration data is an effective basis for fault diagnosis. Conventional fault diagnosis methods include fault feature frequency extraction based on a vibration signal, short-time Fourier transform, empirical mode decomposition, a sparse representation method, and the like. These conventional fault diagnosis methods usually depend on particular a priori knowledge and require professional signal processing technologies and manual extraction of appropriate features, and are therefore not applicable to the processing of massive amount of vibration data. For deficiencies in the conventional fault diagnosis methods, deep learning is widely applied to the field of fault diagnosis. An artificial intelligence-based fault diagnosis framework usually includes four stages: data acquisition, model establishment, model training, and model verification. A deep learning-based fault diagnosis method can automatically extract features, increase computing speed, and meet the requirement of processing massive amount of information in the era of big data. In addition, a deep learning model does not require manual extraction of features, and the deep learning model can automatically learn features without a large amount of priori knowledge. The development of computer technologies also promotes the vigorous development of deep learning-based fault diagnosis technologies.

In conventional deep learning methods for fault diagnosis, it is assumed that training data and test data obey the same distribution, and prominent achievements have been made. However, this assumption is rather questionable in actual industrial applications. In one aspect, a rotary machine is usually in an operating environment with complex rotational speeds and loads, and historical data used for training a model and real-time data acquired during actual status monitoring of equipment conform to different distributions, resulting in reduced universality and generalization of a model based on a conventional deep learning method. In another aspect, during actual applications, it is hardly possible to acquire sufficient vibration data of each type of equipment status under all working conditions to train a specific model to meet diagnosis requirement.

SUMMARY OF THE INVENTION

To resolve the foregoing technical problems, an object of the present invention is to provide a highly accurate and effective intra-class adaptation fault diagnosis method for a bearing under variable working conditions, to improve the accuracy and effectiveness of fault diagnosis for a rolling bearing under variable working conditions. The method includes the following steps:

Step 1: acquiring bearing vibration data in different health states under different working conditions, using the bearing vibration data in the different health states under each working condition as one domain, where data in different domains conforms to different distributions, and segmenting the data to form samples;

Step 2: performing an FFT on samples in a source domain and samples in a target domain, and feeding labeled samples in the source domain and unlabeled samples in the target domain at the same time into a deep intra-class adaptation convolutional neural network model with initialized parameters in a training stage;

Step 3: extracting low-level features of the samples by using improved ResNet-50 in the deep intra-class adaptation convolutional neural network model, performing, by a multi-scale feature extractor, further analysis based on the low-level features to obtain high-level features as an input of a classifier, and at the same time calculating the conditional distribution distance between the high-level features of the samples in the two domains;

Step 4: combining the conditional distribution distance between the source domain and the target domain and classification loss of samples in the source domain to form a target function, optimizing the target function by using a stochastic gradient descent (SGD) method, and training the parameters of the model; and

Step 5: inputting a sample set of the target domain into a trained deep neural network diagnosis model, qualitatively and quantitatively determining a fault type and a fault size of each test sample by using an actual outputted label value, performing comparison with labels that are marked in advance but do not participate in training, to obtain diagnosis accuracy to verify the universality and generalization of the present invention.

In an embodiment, Step 1 specifically includes the following steps:

Step 1.1: establishing data sets of different workloads (that is, different working conditions), where each data set is named after a workload of the data set, data in the data sets conforms to different distributions, and each data set includes a normal bearing state, an outer ring fault, an inner ring fault, and different fault sizes; and

Step 1.2: segmenting samples with N consecutive sampling points as one sample length to make a data set, and using

s={(x_(i) ^(s),y_(i) ^(s))}n_(s)−1 (i=0) in the present invention, where y_(i) ^(s)∈{0,1,2, . . . ,C−1} represents a source domain formed by samples with C different types of labels, x_(i) ^(s) represents an i^(th) sample in the source domain, y_(i) ^(s) represents a label of the i^(th) sample in the source domain, and n_(s) is a total quantity of samples in the source domain; using

_(t)={x_(j) ^(t)}n_(t)−1 (j=0) to represent a target domain formed by the unlabeled samples, where x_(j) ^(t) represents a j^(th) sample in the target domain, and n_(t) is a quantity of all samples in the target domain; and acquiring data of the source domain in a probability distribution P_(s), and acquiring data of the target domain in a probability distribution P_(t), where P_(s)≠P_(t).

In an embodiment, Step 2 specifically includes the following steps:

performing the FFT on the labeled samples in the source domain and the unlabeled samples in the target domain, and converting a time domain signal into a frequency domain signal, where an FFT formula of a time extraction algorithm is shown as follows:

$\begin{matrix} {{{X(k)} = {\sum\limits_{n = 0}^{N - 1}{x(n)W_{N}^{nk}}}},{0 \leq k \leq {N - 1}},{W_{N} = e^{{- j}\frac{2\pi}{N}}}} & (1) \end{matrix}$ $\left\{ {\begin{matrix} {{X(k)} = {{X_{1}(k)} + {W_{N}^{k}{X_{2}(k)}}}} \\ {{X\left( {k + \frac{N}{2}} \right)} = {{X_{1}(k)} - {W_{N}^{k}{X_{2}(k)}}}} \end{matrix},{k = 0},1,2,{{\ldots\frac{N}{2}} - 1},} \right.$

where x(n) represents a value of an n^(th) sampling point in an original sample time sequence, and X(k) represents a k^(th) value in a spectrum graph.

In an embodiment, Step 3 specifically includes the following steps:

Step 3.1: modifying the structure of ResNET-50, and removing the last two layers of the model: a global average pooling layer and a fully connected layer used for classification, where the deep intra-class adaptation convolutional neural network model extracts the low-level features of the samples by using the improved ResNet-50, and a process of the extraction is as follows:

g(x)=f(x)   (2),

where x represents a sample in a frequency domain after the FFT, f(⋅) represents the modified ResNet-50, and g(x) represents the low-level features extracted from the samples by using the improved ResNet-50;

Step 3.2: further analyzing, by a plurality of substructures of the multi-scale feature extractor, the low-level features at the same time to obtain the high-level features as inputs of a softmax classifier, where a process of extracting the high-level features is represented as follows:

g(x)=[g ₀(x),g ₁(x), . . . ,g _(n−1)(x)]  (3),

where g_(i)(x) is the output of one substructure, i 531 {0,1,2, . . . ,n−1}, and n is the total quantity of substructures in the feature extractor; and the softmax function is represented as follows:

$\begin{matrix} {{q_{i} = \frac{e^{Vi}}{\sum\limits_{i = 0}^{C - 1}e^{V_{i}}}},} & (4) \end{matrix}$

where q_(i) represents the probability that a sample belongs to the label i, C is the total quantity of label classes, and v_(i) is the value of the i^(th) position of an input of the softmax function; and

Step 3.3: calculating the conditional distribution distance between the high-level features in the source domain and the target domain, where a formula for a conditional distance between features extracted by one substructure of the multi-scale feature extractor is as follows:

$\begin{matrix} {{{d_{H}\left( {X_{s},X_{t}} \right)} = {\frac{1}{C}{\sum\limits_{c0}^{c1}{{{\frac{1}{n_{s}^{(c)}}{\sum\limits_{i = 0}^{n_{s}^{(c)} - 1}{\Phi\left( x_{i}^{s(c)} \right)}}} - {\frac{1}{n_{t}^{(c)}}{\sum\limits_{j = 0}^{n_{t}^{(c)} - 1}{\Phi\left( x_{j}^{t(c)} \right)}}}}}_{H}^{2}}}},} & (c) \end{matrix}$

where H represents the reproducing kernel Hilbert space, and Φ(⋅) represents a function of feature space mapping; x_(i) ^(s(c)) represents the i^(th) sample in samples with a label of c in the source domain, n_(s) ^((c)) is equal to the quantity of all samples with the label of c in the source domain, x_(j) ^(t(c)) represents the j^(th) sample in samples with a pseudo label of c in the target domain, and n_(i) ^((c)) is equal to the quantity of all samples with the pseudo label of c in the target domain; the foregoing expression is used for estimating a difference between intra-class condition distributions P_(s)(x_(s)|y_(s)=c) and P_(t)(x_(t)|y_(t)=c); the conditional distribution difference between the source domain and the target domain can be reduced by minimizing the foregoing expression; and because the high-level features are extracted by the plurality of substructures at the same time, a total conditional distribution distance is as follows:

$\begin{matrix} {{{d\left( {X_{s},X_{t}} \right)} = {\sum\limits_{1 = 0}^{n - 1}{d\left( {{g_{i}\left( X_{s} \right)},{g_{i}\left( X_{t} \right)}} \right)}}},} & (6) \end{matrix}$

where g_(i)(x) is the output of one substructure, i∈{0,1,2, . . . ,n−1}, and n is the total quantity of substructures in the feature extractor.

In an embodiment, Step 4 specifically includes the following steps:

Step 4.1: calculating classification loss of the samples in the source domain in the training process, where a process of the calculation is shown by the following formula:

$\begin{matrix} {{{los{s_{classifier}\left( {y,X} \right)}} = {\frac{1}{n}{\sum\limits_{1 = 0}^{n - 1}{J\left( {y_{i},{F\left( x_{i} \right)}} \right)}}}},} & (7) \end{matrix}$

where X represents a set of all samples in the source domain, and y represents a set of actual labels of all the samples in the source domain; n is the quantity of samples that participate in training, y_(i) is the actual label of an i^(th) sample, and F(x_(i)) is the predicted result of the i^(th) sample by a neural network; and J(⋅,⋅) represents a cross entropy loss function, and is defined as follows:

$\begin{matrix} {{{J\left( {p,q} \right)} = {- {\sum\limits_{i = 0}^{C - 1}{p_{i}{\log\left( q_{i} \right)}}}}},} & (8) \end{matrix}$

where when i is the actual label of the sample, p_(i) is equal to 1, or otherwise, p_(i) is equal to 0; q_(i) is a probability outputted after softmax activation function; and C is the total quantity of label classes; and

Step 4.2: combining the conditional distribution distance and classification loss of the samples in the source domain to form a multi-scale high-level feature alignment target function to be optimized, where a formula of the target function is as follows:

$\begin{matrix} \begin{matrix} {l_{total} = {{\min{l_{classifier}\left( {y_{s},X_{s}} \right)}} + {\lambda{\sum\limits_{i = 0}^{n_{sub} - 1}{d\left( {{g_{i}\left( X_{s} \right)},{g_{i}\left( X_{t} \right)}} \right)}}}}} \\ {{= {{\min\limits_{F}\frac{1}{n_{s}}{\sum\limits_{i = 0}^{n_{s} - 1}{J\left( {y_{i}^{s},{F\left( \times_{i}^{s} \right)}} \right)}}} + {\lambda{\sum\limits_{i = 0}^{n_{sub} - 1}{d_{H}\left( {{g_{i}\left( X_{s} \right)},{g_{i}\ \left( X_{t} \right)}} \right)}}}}},} \end{matrix} & (9) \end{matrix}$

where F(⋅) represents a model output function, g(⋅) represents an output of one substructure in the multi-scale feature extractor, J(⋅,⋅) represents the cross entropy loss function, λ>0 is a superparameter, n_(sub) is equal to a quantity of substructures in the multi-scale feature extractor, and d^(H)(⋅,⋅) is the conditional distribution distance; the foregoing expression may be used to enable the network F(⋅) provided from training to accurately predict labels of samples from the target domain; and the superparameter λ in the foregoing expression is set as follows:

$\begin{matrix} {{\lambda = {\frac{2}{\frac{{- 10^{\star}}{epoch}}{1 + e^{epochs}}} - 1}},} & (10) \end{matrix}$

where epochs is the total quantity of times of training, and epoch is the current quantity of training steps; and

Step 4.3: minimizing the multi-scale high-level feature alignment target function by using the SGD method, updating the parameters of the model, and training the model:

$\begin{matrix} {{\theta_{i} < {?{{{\theta_{i}/\alpha}{\frac{\partial}{\partial\theta_{i}}l^{*}}\pounds} +}}},} & (11) \end{matrix}$

where θ is all the parameters of the model, and θ_(i) represents the i^(th) parameter; and l(θ) represents a target function related to the parameter θ, and α is a learning rate, that is, a step size.

In an embodiment, Step 5 specifically includes the following steps:

feeding the unlabeled samples in the target domain into a trained multi-scale deep intra-class adaptation convolutional neural network model to obtain predicted labels of all samples in the target domain, and performing comparison with labels that are manually marked in advance but do not participate in a training process, to obtain diagnosis accuracy to verify the high quality of the model, where a formula for calculating the diagnosis accuracy is as follows:

$\begin{matrix} {{acc} = {\frac{1}{n_{t}}{\sum\limits_{i = 0}^{n_{t} - 1}{{sign}\left( {{{F\left( \times_{i}^{t} \right)} = \left( y_{i}^{t} \right)},} \right.}}}} & (12) \end{matrix}$

where sign( ) represents an indication function, is the actual label of the i^(th) sample in the target domain, F(x_(i) ^(t)) is the predicted result of the i^(th) sample in the target domain by the model, and n_(t) is the total quantity of samples in the target domain.

The invention also provides a computer device, including a memory, a processor, and a computer program that is stored on the memory and is executable by the processor, where the processor is configured to execute the program to implement the steps in any foregoing method.

The invention further provides a computer-readable storage medium, on which a computer program is stored, where the program is executed by a processor to implement the steps in any foregoing method.

The invention further provides a processor, which is configured to execute a program, where the program is executed to perform any foregoing method.

By means of the foregoing solutions, the present invention has the following advantages:

1. Manual feature extraction from a large amount of priori knowledge is not required, the training of a neural network is accelerated by using computer hardware, and real-time monitoring is used to predict the health status of equipment in time, thereby achieving an online diagnosis effect, saving a large amount of manpower and material resources, and improving the production and operation efficiency.

2. A convolutional neural network and a transfer learning algorithm are combined, and the conditional distribution distance between samples in a source domain and samples in a target domain is calculated as a part of the target function for optimization, to adequately eliminate the bottleneck that the further development of deep learning in the field of fault diagnosis is hindered because the assumption that data in a training set and data in a test set obey the same distribution in conventional deep learning is questionable in actual industrial applications, so that a model can better process bearing vibration data under variable working conditions, thereby greatly improving the universality and generalization of the model, and the model is widely applicable to fault diagnosis tasks under variable working conditions of complex systems such as mechanical systems, metallurgical systems, electrical systems, and aviation systems.

The foregoing description is merely brief description of the technical solution of the present invention. For a clearer understanding of the technical measure of the present invention and implementation according to the content of the specification, the preferred embodiments of the present invention are described below in detail with reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows the steps of a fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to the present invention.

FIG. 2 is a structural diagram of a corresponding deep learning model according to the present invention.

FIG. 3 is a detailed structural diagram of ResNet-50 in a deep learning model according to the present invention.

FIG. 4 is a principle diagram of residual blocks in ResNet-50.

FIG. 5 is a flowchart of a corresponding diagnosis method according to the present invention.

FIG. 6 is a diagram of a frequency domain of a vibration signal of a bearing in different health states according to an embodiment of the present invention.

FIG. 7 is a diagram of classification results of a target domain (test set) of bearing faults according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Specific implementations of the present invention are further described below in detail with reference to the accompanying drawings and embodiments. The following embodiments are used to describe the present invention, but are not used to limit the scope of the present invention.

The present invention is described below in detail with reference to actual experimental data:

The experimental data uses a bearing data set from Case Western Reserve University. A data acquisition system is formed by three major parts: a motor, a torque sensor, and a dynamometer machine. An accelerometer is utilized to acquire vibration data, and the sampling frequency is 12 KHz. Faults are introduced into the roller, the inner ring, and the outer ring by using electrical discharge machining (EDM) technologies, and different fault sizes are set.

As shown in FIG. 1, the present invention includes the following steps:

Step 1: acquiring bearing vibration data in different health states under different working conditions, using the bearing vibration data in the different health states under each working condition as one domain, where data in different domains conforms to different distributions, and segmenting the data to form samples;

Step 2: performing an FFT on samples in a source domain and samples in a target domain, and feeding labeled samples in the source domain and unlabeled samples in the target domain at the same time into a deep intra-class adaptation convolutional neural network model with initialized parameters in a training stage;

Step 3: extracting low-level features of the samples by using improved ResNet-50 in the deep intra-class adaptation convolutional neural network model, performing, by a multi-scale feature extractor, further analysis based on the low-level features to obtain high-level features as inputs of a classifier, and at the same time calculating the conditional distribution distance between the high-level features of the samples in the two domains;

Step 4: combining the conditional distribution distance between the source domain and the target domain and classification loss of samples in the source domain to form the target function, optimizing the target function by using an SGD method, and training the parameters of the model; and

Step 5: inputting a sample set of the target domain into a trained deep neural network diagnosis model, qualitatively and quantitatively determining a fault type and a fault size of each test sample by using actual outputted label values, and performing comparison with labels that are marked in advance but do not participate in training, to obtain diagnosis accuracy to verify the universality and generalization of the present invention.

Further, Step 1 specifically includes the following steps:

Step 1.1: Establishing data sets of different workloads (that is, different working conditions), where each data set is named after a workload of the data set, data in the data sets conforms to different distributions, and each data set includes a normal bearing state, an outer ring fault, an inner ring fault, and different fault sizes.

In this embodiment, data sets (0, 1, 2 and 3 hp) under four different working conditions are established. That is, variable loads are used to simulate a transfer learning task of a rolling bearing under variable working conditions. These data sets are named after the workloads of the data sets. For example, a data set 0 hp represents that samples come from vibration signals acquired under 0 hp workload. Therefore, the four data sets of variable loads represent four domains with different data distributions. Single-point faults are created at the roller, the inner ring, and the outer ring of a bearing by using the EDM technologies, and fault degrees are 0.007 inches, 0.014 inches, and 0.021 inches respectively.

Step 1.2: Segmenting samples with N consecutive sampling points as one sample length to make a data set, and using

s={(x_(i) ^(s),y_(i) ^(s))}n_(s)−1 (i=0) in the present invention, where y_(i) ^(s)∈{0,1,2, . . . ,C−1} represents a source domain formed by samples with C different types of labels, x_(i) ^(s) represents the i^(th) sample in the source domain, y_(i) ^(s) represents the label of the i^(th) sample in the source domain, and n_(s) is the total quantity of samples in the source domain; using

_(t)={x_(j) ^(t)}n_(t)−1 (j=0) to represent a target domain formed by the unlabeled samples, where x_(j) ^(t) represents the j^(th) sample in the target domain, and n_(t) is the quantity of all samples in the target domain; and acquiring data of the source domain in a probability distribution P_(s), and acquiring data of the target domain in a probability distribution P_(t), where P_(s)≠P_(t). For specific types of samples in each domain, reference may be made to Table 1.

TABLE 1 Detailed description of 10 types of samples in each domain Sample Symbol Fault size/inch Status Label quantity representation — Normal 0 200 NO 0.007 Inner ring fault 1 200 IF07 0.007 Roller fault 2 200 BF07 0.007 Outer ring fault 3 200 OF07 0.014 Inner ring fault 4 200 IF14 0.014 Roller fault 5 200 BF14 0.014 Outer ring fault 6 200 OF14 0.021 Inner ring fault 7 200 IF21 0.021 Roller fault 8 200 BF21 0.021 Outer ring fault 9 200 OF21

A diagnosis task under variable working conditions is represented by a symbol A hp→B hp. The source domain is a hp data set. All samples and labels of the samples participate in a training process. B hp represents the target domain, and actual labels of samples in the target domain do not participate in training and are only used for verification process.

Further, Step 2 specifically includes the following steps:

performing the FFT on the labeled samples in the source domain and the unlabeled samples in the target domain, and converting a time domain signal into a frequency domain signal, where an FFT formula of a time extraction algorithm is shown as follows:

$\begin{matrix} {{{X(k)} = {\sum\limits_{n = 0}^{N - 1}{{x(n)}W_{N}^{nk}}}},{0 \leq k \leq {N - 1}},{W_{N} = e^{{- j}\frac{2\pi}{N}}}} & (1) \end{matrix}$ $\left\{ {\begin{matrix} {{X(k)} = {{X_{1}(k)} + {W_{N}^{k}{X_{2}(k)}}}} \\ {{X\left( {k + \frac{N}{2}} \right)} = {{X_{1}(k)} - {W_{N}^{k}{X_{2}(k)}}}} \end{matrix},{k = 0},1,2,{{\ldots\frac{N}{2}} - 1},} \right.$

where x(n) represents the value of the n^(th) sampling point in an original sample time sequence, and X(k) represents the k^(th) value in a spectrum graph. A frequency domain signal of each type of sample is shown in FIG. 6.

Further, Step 3 specifically includes the following steps:

A deep learning model established in this embodiment is shown in FIG. 2, and a fault diagnosis procedure is shown in FIG. 5, including:

Step 3.1: for a detailed structure of ResNet-50 shown in FIG. 3 and FIG. 4, modifying the structure of ResNet-50, and removing the last two layers of the model: a global average pooling layer and a fully connected layer used for classification, where the deep intra-class adaptation convolutional neural network model extracts the low-level features of the samples by using the improved ResNet-50, and a process of the extraction is as follows:

g(x)=f(x)   (2),

where x represents a sample in a frequency domain after the FFT, f(⋅) represents the modified ResNet-50, and g(x) represents the low-level features extracted from the samples by using the improved ResNet-50.

Step 3.2: further analyzing, by a plurality of substructures of the multi-scale feature extractor, the low-level features at the same time to obtain the high-level features as an input of the softmax classifier, where a process of extracting the high-level features is represented as follows:

g(x)=[g ₀(x),g ₁(x), . . . ,g _(n−1)(x)]  (3),

where g_(i)(x) is an output of one substructure, i∈{0,1,2, . . . ,n−1}, and n is a total quantity of substructures in the feature extractor; and the softmax function is represented as follows:

$\begin{matrix} {{q_{i} = \frac{e^{Vi}}{\sum\limits_{i = 0}^{C - 1}e^{V_{i}}}},} & (4) \end{matrix}$

where q_(i) represents the probability that a sample belongs to the label i, C is the total quantity of label classes, and v_(i) is the value of the i^(th) position of an input of the softmax function; and

Step 3.3: calculating the conditional distribution distance between the high-level features in the source domain and the target domain, where a formula for the conditional distance between features extracted by one substructure of the multi-scale feature extractor is as follows:

$\begin{matrix} {{{d_{H}\left( {X_{s},X_{t}} \right)} = {\frac{1}{C}{\sum\limits_{c = 0}^{C - 1}{{{\frac{1}{n_{s}^{(c)}}{\sum\limits_{i = 0}^{n_{s}^{(c)}‐1}{\Phi\left( X_{i}^{s(c)} \right)}}} - {\frac{1}{n_{t}^{(c)}}{\sum\limits_{j = 0}^{n_{t}^{({.c})}‐1}{\Phi\left( X_{j}^{t(c)} \right)}}}}}_{H}^{2}}}},} & (5) \end{matrix}$

where H represents the reproducing kernel Hilbert space, and Φ(⋅) represents a function of feature space mapping; x_(i) ^(s(c)) represents the i^(th) sample in samples with a label of c in the source domain, n_(s) ^((c)) is equal to the quantity of all samples with the label of c in the source domain, x_(j) ^(t(c)) represents the j^(th) sample in samples with a pseudo label of c in the target domain, and n_(t) ^((c)) is equal to a quantity of all samples with the pseudo label of c in the target domain; the foregoing expression is used for estimating a difference between intra-class condition distributions P_(s)(x_(s)|y_(s)=c) and P_(t)(x_(t)|y_(t)=c); the conditional distribution difference between the source domain and the target domain can be reduced by minimizing the foregoing expression; and because the high-level features are extracted by the plurality of substructures at the same time, a total conditional distribution distance is as follows:

$\begin{matrix} {{{d\left( {X_{s},X_{t}} \right)} = {\sum\limits_{i = 0}^{n - 1}{d\left( {{g_{i}\left( X_{s} \right)},{g_{i}\left( X_{t} \right)}} \right)}}},} & (6) \end{matrix}$

where g_(i)(x) is the output of one substructure, i∈{0,1,2, . . . ,n−1}, and n is the total quantity of substructures in the feature extractor.

Further, Step 4 specifically includes the following steps:

Step 4.1: calculating classification loss of samples in the source domain, where a process of the calculation is shown by the following formula:

$\begin{matrix} {{{{loss}_{classifier}\left( {y,X} \right)} = {\frac{1}{n}{\sum\limits_{i = 0}^{n - 1}{J\left( {y_{i},{F\left( x_{i} \right)}} \right)}}}},} & (7) \end{matrix}$

where X represents a set of all samples in the source domain, and y represents a set of actual labels of all the samples in the source domain; n is the quantity of samples that participate in training, y_(i) is the actual label of the i^(th) sample, and F(x_(i)) is the predicted result of the i^(th) sample by a neural network; and J(⋅,⋅) represents the cross entropy loss function, and is defined as follows:

$\begin{matrix} {{{J\left( {p,q} \right)} = {- {\sum\limits_{1 = 0}^{C - 1}{p_{i}\log\left( q_{i} \right)}}}},} & (8) \end{matrix}$

where when i is the actual label of the sample, p_(i) is equal to 1, or otherwise, p_(i) is equal to 0; q_(i) is a probability outputted after the softmax activation function; and C is the total quantity of label classes; and

Step 4.2: combining the conditional distribution distance and the classification loss of the samples in the source domain to form a multi-scale high-level feature alignment target function to be optimized, where a formula of the target function is as follows:

$\begin{matrix} {{l_{total} = {{\min{l_{classifier}\left( {y_{s},X_{s}} \right)}} + {\lambda{\sum\limits_{i = 0}^{n_{sub} - 1}{d\left( {{g_{i}\ \left( X_{s} \right)},{g_{i}\ \left( X_{t} \right)}} \right)}}}}}{{= {{\min\limits_{F}\frac{1}{n_{s}}{\sum\limits_{i = 0}^{n_{s} - 1}{J\left( {y_{i}^{s},{F\left( x_{i}^{s} \right)}} \right)}}} + {\lambda{\sum\limits_{i = 0}^{n_{{sub} -}1}{d_{H}\left( {{g_{i}\left( X_{s} \right)},{g_{i}\left( X_{t} \right)}} \right)}}}}},}} & (9) \end{matrix}$

where F(⋅) represents a model output function, g(⋅) represents an output of one substructure in the multi-scale feature extractor, J(⋅,⋅) represents the cross entropy loss function, λ>0 is a superparameter, n_(sub) is equal to a quantity of substructures in the multi-scale feature extractor, and d_(H)(⋅,⋅) is the conditional distribution distance; the foregoing expression may be used to enable the network F(⋅) provided from training to accurately predict a label of a sample from the target domain; and the superparameter λ in the foregoing expression is set as follows:

λ = 2 - 10 ⋆ ⁢ epoch 1 + e epochs ⁢ ‐ ⁢ 1 , ( 10 )

where epochs is the total quantity of times of training, and epoch is the current quantity of training steps.

Step 4.3: minimizing the multi-scale high-level feature alignment target function by using the SGD method, updating the parameters of the model, and training the model:

$\begin{matrix} {{\theta_{i} < {?{{{\theta_{i}/a}{\frac{\partial}{\partial\theta_{i}}l^{\star}}\pounds} +}}},} & (11) \end{matrix}$

where θ is all the parameters of the model, and θ_(i) represents the i^(th) parameter; and l(θ) represents a target function related to the parameter θ, and α is a learning rate, that is, a step size.

Further, Step 5 specifically includes the following steps:

feeding the unlabeled samples in the target domain into a trained multi-scale deep intra-class adaptation convolutional neural network model to obtain predicted labels of all samples in the target domain, and performing comparison with labels that are manually marked in advance but do not participate in the training process, to obtain diagnosis accuracy to verify the high quality of the model, where a formula for calculating the diagnosis accuracy is as follows:

$\begin{matrix} {{acc} = {\frac{1}{n_{t}}{\sum\limits_{i = 0}^{n_{t} - 1}{{sign}\left( {{F\left( {\left( X_{i}^{t} \right) = y_{i}^{t}} \right)},} \right.}}}} & (12) \end{matrix}$

where sign( ) represents an indication function, y_(i) ^(t) is the actual label of the i^(th) sample in the target domain, F(x_(i) ^(t)) is the predicted result of the i^(th) sample in the target domain by the model, and n_(t) is the total quantity of samples in the target domain. Diagnosis results under 12 variable working conditions are shown in FIG. 7. As can be seen from the diagnosis results, the average accuracy of diagnosis tasks under the 12 variable working conditions reaches 99.10%, and a standard deviation is 0.0080. It indicates that based on the relatively high diagnosis accuracy achieved in the present invention, the universality and generalization of the deep learning model are greatly improved, and the impact of domain shift on a fault diagnosis method based on conventional deep learning under variable working conditions can be adequately handled.

In summary, a multi-scale convolutional intra-class adaptation fault diagnosis model is designed based on a convolutional neural network and a transfer learning algorithm in the present invention. Compared with conventional deep learning methods, the present invention can better mitigate adverse impact of domain shift on a deep learning model, better conform to actual scenarios of industrial applications, and meet the requirement of fault diagnosis under variable working conditions.

The foregoing descriptions are only preferred implementations of the present invention, but are not used to limit the present invention. It should be noted that for a person of ordinary skill in the art, several improvements and variations may further be made without departing from the technical principle of the present invention. These improvements and variations should also be deemed as falling within the protection scope of the present invention. 

1. A fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning, comprising: Step 1: acquiring bearing vibration data in different health states under different working conditions, using the bearing vibration data in the different health states under each working condition as one domain, wherein data in different domains conforms to different distributions, and segmenting the data to form samples; Step 2: performing a fast Fourier transform (FFT) on samples in a source domain and samples in a target domain, and feeding labeled samples in the source domain and unlabeled samples in the target domain at the same time into a deep intra-class adaptation convolutional neural network model with initialized parameters in a training stage; Step 3: extracting low-level features of the samples by using improved ResNet-50 in the deep intra-class adaptation convolutional neural network model, performing, by a multi-scale feature extractor, further analysis based on the low-level features to obtain high-level features as an input of a classifier, and at the same time calculating a conditional distribution distance between the high-level features of the samples in the two domains; Step 4: combining the conditional distribution distance between the source domain and the target domain and classification loss of samples in the source domain to form a target function, optimizing the target function by using a stochastic gradient descent (SGD) method, and training the parameters of the model; Step 5: inputting a sample set of the target domain into a trained deep neural network diagnosis model, qualitatively and quantitatively determining a fault type and a fault size of each test sample by using an actual outputted label value, and performing comparison with labels that are marked in advance but do not participate in training, to obtain diagnosis accuracy.
 2. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 1, wherein Step 1 comprises: Step 1.1: establishing data sets of different workloads, wherein each data set is named after a workload of the data set, and data in the data sets conforms to different distributions; and Step 1.2: segmenting samples with N consecutive sampling points as one sample length to make a data set, and using

s={(x_(i) ^(s),y_(i) ^(s))}n_(s)−1 (i=0), wherein y_(i) ^(s)∈{0,1,2, . . . ,C−1} represents a source domain formed by samples with C different types of labels, x_(i) ^(s) represents an i^(th) sample in the source domain, represents a label of the i^(th) sample in the source domain, and n_(s) is a total quantity of samples in the source domain; using

_(t)={x_(j) ^(t)}n_(t)−1 (j=0) to represent a target domain formed by the unlabeled samples, wherein x_(j) ^(t) represents a i^(th) sample in the target domain, and n_(t) is a quantity of all samples in the target domain; acquiring data of the source domain in a probability distribution P_(s), and acquiring data of the target domain in a probability distribution P_(t), wherein P_(s)≠P_(t), and the data of the source domain and the data of the target domain conform to different distributions.
 3. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 2, wherein in Step 1.2, all labeled samples in the source domain and labels of the samples and the unlabeled samples in the target domain are used for training, and labels of samples in the target domain are only used for a test process and do not participate in training.
 4. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 1, wherein Step 3 comprises: Step 3.1: modifying the structure of ResNet-50, and removing the last two layers of the model: a global average pooling layer and a fully connected layer used for classification, wherein the deep intra-class adaptation convolutional neural network model extracts the low-level features of the samples by using the improved ResNet-50, and a process of the extraction is as follows: g(x)=f(x) wherein x represents a sample in a frequency domain after the FFT, f(⋅) represents the modified ResNet-50, and g(x) represents the low-level features extracted from the samples by using the improved ResNet-50; Step 3.2: further analyzing, by a plurality of substructures of the multi-scale feature extractor, the low-level features at the same time to obtain the high-level features as an input of a softmax classifier, wherein a process of extracting the high-level features is represented as follows: g(x)=[g ₀(x),g ₁(x), . . . ,g_(n−1)(x)], wherein g_(i)(x) is an output of one substructure, i∈{0,1,2, . . . ,n−1}, and n is a total quantity of substructures in the feature extractor; and a softmax function is represented as follows: ${q_{i} = \frac{e^{V_{1}}}{\sum\limits_{i = 0}^{C - 1}e^{V_{i}}}},$ wherein q_(i) represents a probability that a sample belongs to a label i, C is a total quantity of label classes, and v_(i) is a value of an i^(th) position of an input of the softmax function; and Step 3.3: calculating the conditional distribution distance between the high-level features in the source domain and the target domain, wherein because labels of samples in the target domain are unknown in the training process, it seems impossible to match the conditional distribution distance between the source domain and the target domain, and predetermined results for samples in the target domain by a deep learning model in a training iteration process are used as pseudo labels to calculate the conditional distribution distance between the source domain and the target domain, and a formula for a conditional distribution distance between features extracted by one substructure of the multi-scale feature extractor is as follows: ${{d_{H}\left( {X_{s},X_{t}} \right)} = {\frac{1}{C}{\sum\limits_{c = 0}^{C - 1}{{{\frac{1}{n_{s}^{(c)}}{\sum\limits_{i = 0}^{n_{s}^{(c)}‐1}{\Phi\left( X_{i}^{s(c)} \right)}}} - {\frac{1}{n_{t}^{(c)}}{\sum\limits_{j = 0}^{n_{t}^{(c)}‐1}{\Phi\left( X_{j}^{t(c)} \right)}}}}}_{H}^{2}}}},$ wherein H represents the reproducing kernel Hilbert space, and Φ(⋅) represents a function of feature space mapping; x_(i) ^(s(c)) represents an i^(th) sample in samples with a label of c in the source domain, n_(s) ^((c)) is equal to a quantity of all samples with the label of c in the source domain, x_(j) ^(t(c)) represents a j^(th) sample in samples with a pseudo label of c in the target domain, and n_(t) ^((c)) is equal to a quantity of all samples with the pseudo label of c in the target domain; the foregoing expression is used for estimating a difference between intra-class condition distributions P_(s)(x_(s)|y_(s)=c) and P_(t)(x_(t)|y_(t)=c); a conditional distribution difference between the source domain and the target domain can be reduced by minimizing the foregoing expression; and because the high-level features are extracted by the plurality of substructures at the same time, a total conditional distribution distance is as follows: ${{d\left( {X_{s},X_{t}} \right)} = {\sum\limits_{i = 0}^{n - 1}{d\left( {{g_{i}\left( X_{s} \right)},{g_{i}\left( X_{t} \right)}} \right)}}},$ wherein g_(i)(x) is the output of one substructure, i∈{0,1,2, . . . ,n−1}, and n is the total quantity of substructures in the feature extractor; although pseudo labels rather than actual labels of samples in the target domain are used in the training process, as a quantity of iterations increases, a training loss keeps decreasing, and the pseudo labels keep approaching the actual labels, to maximize the accuracy of classifying samples in the target domain.
 5. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 1, wherein Step 4 comprises: Step 4.1: calculating classification loss of the samples in the source domain in the training process, wherein a process of the calculation is shown by the following formula: ${{{loss}_{classifier}\left( {y,X} \right)} = {\frac{1}{n}{\sum\limits_{i = 0}^{n - 1}{J\left( {y_{i},{F\left( x_{i} \right)}} \right)}}}},$ wherein X represents a set of all samples in the source domain, and y represents a set of actual labels of all the samples in the source domain; n is a quantity of samples that participate in training, y_(i) is an actual label of an i^(th) sample, and F(x_(i)) is a predicted result of the i^(th) sample by a neural network; and J(⋅,⋅) represents a cross entropy loss function, and is defined as follows: ${{J\left( {p,q} \right)} = {- {\sum\limits_{i = 0}^{C - 1}{p_{i}\log\left( q_{i} \right)}}}},$ wherein when i is an actual label of the sample, p_(i) is equal to 1, or otherwise, p_(i) is equal to 0; q_(i) is a probability outputted after a softmax activation function; and C is a total quantity of label classes; and Step 4.2: combining the conditional distribution distance and the label training prediction loss of the samples in the source domain to form a multi-scale high-level feature alignment target function to be optimized, wherein a formula of the target function is as follows: ${l_{total} = {{\min{l_{classifier}\left( {y_{s},X_{s}} \right)}} + {\lambda{\sum\limits_{i = 0}^{n_{sub} - 1}{d\left( {{g_{i}\ \left( X_{s} \right)},{g_{i}\ \left( X_{t} \right)}} \right)}}}}}{{= {{\min\limits_{F}\frac{1}{n_{s}}{\sum\limits_{i = 0}^{n_{s} - 1}{J\left( {y_{i}^{s},{F\left( x_{i}^{s} \right)}} \right)}}} + {\lambda{\sum\limits_{i = 0}^{n_{sub} - 1}{d_{H}\left( {{g_{i}\ \left( X_{s} \right)},{g_{i}\ \left( X_{t} \right)}} \right)}}}}},}$ wherein F(⋅) represents a model output function, g(⋅) represents an output of one substructure in the multi-scale feature extractor, J(⋅,⋅) represents the cross entropy loss function, λ>0 is a superparameter, n_(sub) is equal to a quantity of substructures in the multi-scale feature extractor, and d_(H)(⋅,⋅) is the conditional distribution distance; and the foregoing expression may be used to enable the network F(⋅) provided from training to accurately predict labels of samples from the target domain.
 6. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 5, wherein the superparameter λ is set as follows: λ = 2 10 ⋆ ⁢ epoch 1 + e epochs ⁢ ‐ ⁢ 1 , wherein epochs is a total quantity of times of training, and epoch is a current quantity of training steps.
 7. The fault diagnosis method for a rolling bearing under variable working conditions based on a convolutional neural network and transfer learning according to claim 1, wherein Step 5 comprises: feeding the unlabeled samples in the target domain into a trained multi-scale deep intra-class adaptation convolutional neural network model to obtain predicted labels of all samples in the target domain, and performing comparison with labels that are manually marked in advance but do not participate in a training process, to obtain diagnosis accuracy to verify the high quality of the model.
 8. A computer device, comprising a memory, a processor, and a computer program that is stored in the memory and is executable by the processor, wherein the processor is configured to execute the program to implement the steps in the method according to claim
 1. 9. A computer-readable storage medium, on which a computer program is stored, wherein the program is executed by a processor to implement the steps in the method according to claim
 1. 10. A processor, configured to execute a program, wherein the program is executed to perform the method according to claim
 1. 